const { Get, Controller } = require("../decorator/router")
const { IPHONE_DETAILS_MODEL } = require("../dataDB/homeData")
const {
    JudgeAnObject,
    dataErrorReturn
} = require("../util/util")

@Controller('/iphones_details')
class iphomes {
    @Get('/:id')
    async iphones_details(ctx, next) {
        const id = ctx.params.id
        const dataUrl = await IPHONE_DETAILS_MODEL.findOne(
            {'id.id': id},
            {'__v': false, _id: false}
        )
        dataErrorReturn({dataUrl, ctx})
    }
}